#include <iostream>
using namespace std;

int main() {
    int n,m;
    cin >> n >> m;
    int light[5000]; // 1关闭，0打开

    for (int i = 1; i <= m; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            if (i == 1)
            {
                light[j] = 1;
            }  
            else {
                if (j % i == 0)
                {
                    if (light[j] == 0)
                    {
                        light[j] = 1;
                    }
                    else
                    {
                        light[j] = 0;
                    }
                }
            }
        }
    }
    int isFirst = 1;
    for (int i = 1; i <= n; i++)
    {
        if (light[i] == 1)
        {
            if (isFirst == 1)
            {
                cout << i;
                isFirst = 0;
            }
            else
            {
                cout << ',' << i;
            }
        }
    }
 
    return 0;
}